var settings = {
    'force_size': 0,         		// 	if set to 1 all banners will be resized to the width and height in the next to settings
    'img_width': 707, 		//	width to resize all banners to, only takes effect if above is 1
    'img_height': 80, 			// 	height to resize all banners to, only takes effect if above is 1

    'refresh_time': 0, 		//	the seconds between refreshs of the banners - use 0 to disable
    'refresh_max': 100, 			//	maximum number of refreshs on each page load

    'duplicate_banners': 0, 			//	keep as 0 to make sure the same banner won't show on the same page. will only take effect
    //  if show_banners(); is used more than once. You must make sure you have enough banners to fill
    //  all the slots else the browser may freeze or give a stack overflow error

    'location_prefix': 'adLocation-', //	The prefix of the IDs of the <div> which wraps the banners - this div is generated dynamically.
    //  a number will be added on the end of this string. adLocation- was used by default before version 1.4.x

    'location_class': 'swb', 		//  A class to add to all of the <div>s which wrap the banners, ideal to use for styling banners - use .swb img in your CSS	

    'window': '_self', 	//	Window to open links in, _self = current, _blank = new. Use _top if in a frame!		

    'default_ad_loc': 'default'		//	The default adLocation. This is assigned to any banners not given an adLocation in the below banner list
    //  There is no real reason to need to change this
}


/**
Banners
**/
// banner list syntax: new banner(website_name, website_url, banner_url, show_until_date, adlocation),  DATE FORMAT: dd/mm/yyyy
// if you're not using adlocations just leave it empty like '' as in the last example here
// to make sure a banner is always rotating, just set the date far into the future, i.e. year 3000

var banners = [
	new banner('iStyle', 'http://zhangxiaozhou.taobao.com', 'http://src.xidong.net/images/ads/1.gif', '30/04/2019', 'b1')
]

//         				There is no need to edit below here
///////////////////////////////////////////////////////////////////////////////////
var used = 0; var location_counter = 0; var refresh_counter = 1; var map = new Array(); function banner(a, b, c, d, e) { this.name = a; this.url = b; this.image = c; this.date = d; this.active = 1; this.oid = 0; if (e != '') { this.loc = e } else { this.loc = settings.default_ad_loc } } function show_banners(a) { location_counter = location_counter + 1; if (a != '' && a != undefined) { map[location_counter] = a } else { map[location_counter] = settings.default_ad_loc } var b = '<div id="' + settings.location_prefix + location_counter + '" class="' + settings.location_class + '"></div>'; document.write(b); display_banners(location_counter) } function display_banners(a) { var b = new Array(); if (a == '' || !a || a < 0) { return } var c = banners.length; if ((c == used) && settings.duplicate_banners == 0) { return } for (i = 0; i < (banners.length); i++) { banners[i].oid = i; if ((banners[i].loc == map[a]) && (banners[i].active == 1)) { b.push(banners[i]) } } var d = Math.floor(Math.random() * b.length); var e = b[d]; var f = (settings.force_size == 1) ? ' width="' + settings.img_width + '" height="' + settings.img_height + '"' : ''; var g = '<a href="' + e.url + '" title="' + e.name + '" target="' + settings.window + '"><img border="0" src="' + e.image + '"' + f + ' alt="' + e.name + '" /></a>'; var h = new Date(); var j = e.date; j = j.split('/', 3); var k = new Date(); k.setFullYear(parseInt(j[2]), parseInt(j[1]) - 1, parseInt(j[0])); if ((h < k) && e.active == 1) { var l = document.getElementById(settings.location_prefix + a); if (l == null) { alert('spyka Webmaster banner rotator\nError: adLocation doesn\'t exist!') } else { l.innerHTML = g; if (settings.duplicate_banners == 0) { banners[e.oid].active = 0; used++ } return } } else { display_banners(a) } return } function refresh_banners() { if ((refresh_counter == settings.refresh_max) || settings.refresh_time < 1) { clearInterval(banner_refresh) } used = 0; for (j = 0; j < (banners.length); j++) { banners[j].active = 1 } for (j = 1; j < (location_counter + 1); j++) { display_banners(j) } refresh_counter++ } var banner_refresh = window.setInterval(refresh_banners, settings.refresh_time);

$(function () {
    //隔行变色
    $('tr').addClass('odd');
    $('tr:even').addClass('even');
    $('#tr_baidu').removeClass();
    //全选
    $("#checkall").change(function () {
        $("input:checkbox").attr("checked", $(this).attr("checked") ? true : false);
    });
    $("td[data-size]").each(function () {
        $(this).text(bytesToSize($(this).attr("data-size")));
    });
    //默认全选中
    $("input:checkbox").attr("checked", "checked");
    $(".cbxitem").each(function () {
        var es = $(this).val().replace("[www.90xz.com]", "");
        var es = es.split("|");
        var fs = es[2].split(".");
        fs[fs.length - 2] = fs[fs.length - 2] + "[www.90xz.com]";
        es[2] = fs.join('.');
        $(this).val(es.join('|'));
        $(this).next().attr("href", $(this).val());
    })

    $('input[value^="ed2k"]').each(function () {
        var es = $(this).val().replace("[www.90xz.com]", "");
        var es = es.split("|");
        var fs = es[2].split(".");
        fs[fs.length - 2] = fs[fs.length - 2] + "[www.90xz.com]";
        es[2] = fs.join('.');
        $(this).val(es.join('|'));
        $(this).next('a').attr("href", $(this).val());

    })
    $('a[href^="ed2k"]').each(function () {
        var es = $(this).attr("href").replace("[www.90xz.com]", "");
        var es = es.split("|");
        var fs = es[2].split(".");
        fs[fs.length - 2] = fs[fs.length - 2] + "[www.90xz.com]";
        es[2] = fs.join('.');
        $(this).attr("href",es.join('|'));
    })


})

Array.prototype.S = String.fromCharCode(2);
Array.prototype.in_array = function (e) {
    var r = new RegExp(this.S + e + this.S);
    return (r.test(this.S + this.join(this.S) + this.S));
}
function bytesToSize(bytes) {
    if (bytes === 0) return '0 B';
    var k = 1024;
    sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
    i = Math.floor(Math.log(bytes) / Math.log(k));
    return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
function getext(imgPath) {
    return (imgPath.substr(imgPath.length - 5)).substr((imgPath.substr(imgPath.length - 5)).indexOf('.') + 1).toLowerCase();
}
function download2(i, first) {
    var str = "cbxitem";
    var a = document.getElementsByName(str);
    var n = a.length;
    //尝试使用activex方式批量新增下载
    try {
        var ed2k_links = '';
        var ax = new ActiveXObject("IE2EM.IE2EMUrlTaker");
        var emule_version = ax.GetEmuleVersion();
        if ('e' != emule_version.substr(0, 1)) {
            throw { errorCode: 'eMule not Installed.' };
        }
        for (var i = i; i < n; i++) {
            if (a[i].checked) {
                if (ed2k_links == '') {
                    ed2k_links = a[i].value;
                } else {
                    ed2k_links += "\n" + a[i].value;
                }
            }
        }
        ax.SendUrl(ed2k_links, 'dd', document.location);
        delete ax;
        return;
    } catch (e) { }

    if (!window.continueDown) {
        //使用最旧的方法来批量新增下载
        for (var i = i; i < n; i++) {
            if (a[i].checked) {
                window.location = a[i].value;
                if (first)
                    timeout = 6000;
                else
                    timeout = 500;
                i++;
                window.setTimeout("download('" + str + "', " + i + ", 0)", timeout);
                break;
            }
        }
    } else {
        //使用稍微新一点的方法来批量新增下载
        for (var i = i; i < n; i++) {
            if (a[i].checked) {
                if (first) {
                    var k = i;
                    var current_link = a[k].nextSibling;
                    var multi_text = '';
                    var tmp_counter = 0;
                    var comma = '';
                    while (true) {
                        if (a[k].checked && current_link) {//如果是有效节点并且被选中
                            if (current_link.href) {
                                if (current_link.href.indexOf('ed2k') !== 0) {
                                    current_link = current_link.nextSibling;
                                    continue;
                                }
                                if (tmp_counter > 7) {//收集超过若干个有效链接后，退出
                                    multi_text += '<br />…………';
                                    break;
                                }
                                var right_link = current_link;
                                tmp_counter++;
                                if (navigator.userAgent.toLowerCase().indexOf("msie") == -1) {
                                    multi_text += comma + current_link.text;
                                } else {
                                    multi_text += comma + current_link.innerText;
                                }
                                comma = '<br />';
                            }

                            current_link = current_link.nextSibling;
                        } else {//未被选中，或往下没有相邻节点了，那么切换到下个父节点
                            if (++k >= n) {//如果父节点也到底了，那么退出
                                break;
                            }
                            current_link = a[k].nextSibling;
                        }
                    }
                    downPopup(right_link, multi_text);
                }

                continueDown(a[i].value);
                //window.location=a[i].value;
                if (first)
                    timeout = 6000;
                else
                    timeout = 500;
                i++;
                window.setTimeout("download('" + str + "', " + i + ", 0)", timeout);
                break;
            }
        }
    }
}
function checkAll(str, checked) {
    var a = document.getElementsByName(str);
    var n = a.length;

    for (var i = 0; i < n; i++) {
        a[i].checked = checked;
    }
    em_size(str);
}


function download(str, i, first) {
    alert(first);
    var a = document.getElementsByName(str);
    var n = a.length;

    for (var i = i; i < n; i++) {
        if (a[i].checked) {
            window.location = a[i].value;
            if (first)
                timeout = 6000;
            else
                timeout = 500;
            i++;
            window.setTimeout("download('" + str + "', " + i + ", 0)", timeout);
            break;
        }
    }

}

function copy(str) {

    var a = document.getElementsByName(str);
    var n = a.length;
    var ed2kcopy = "";
    for (var i = 0; i < n; i++) {
        if (a[i].checked) {
            ed2kcopy += a[i].value;
            ed2kcopy += "\r\n";
        }
    }
    copyToClipboard(ed2kcopy);
}

function copyToClipboard(txt) {
    if (window.clipboardData) {
        window.clipboardData.clearData();
        window.clipboardData.setData("Text", txt);
    } else if (navigator.userAgent.indexOf("Opera") != -1) {
        window.location = txt;
    } else if (window.netscape) {
        try {
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
        } catch (e) {
            alert("!!被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
        }
        var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
        if (!clip)
            return;
        var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
        if (!trans)
            return;
        trans.addDataFlavor('text/unicode');
        var str = new Object();
        var len = new Object();
        var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
        var copytext = txt;
        str.data = copytext;
        trans.setTransferData("text/unicode", str, copytext.length * 2);
        var clipid = Components.interfaces.nsIClipboard;
        if (!clip)
            return false;
        clip.setData(trans, null, clipid.kGlobalClipboard);
    }
}

//计算文件大小
function em_size(str) {
    var a = document.getElementsByName(str);
    var n = a.length;
    try {
        var input_checkall = document.getElementById("checkall_" + str);
        var size = 0;
        input_checkall.checked = true;
        for (var i = 0; i < n; i++) {
            if (a[i].checked) {
                var piecesArray = a[i].value.split("|");
                size += piecesArray[3] * 1;
            } else {
                input_checkall.checked = false;
            }
        }
        test = document.getElementById("size_" + str);
        test.innerHTML = gen_size(size, 3, 1);
    } catch (e) {

    }
}

function gen_size(val, li, sepa) {
    sep = Math.pow(10, sepa);
    li = Math.pow(10, li);
    retval = val;
    unit = 'Bytes';
    if (val >= li * 1000000000) {
        val = Math.round(val / (1099511627776 / sep)) / sep;
        unit = 'TB';
    } else if (val >= li * 1000000) {
        val = Math.round(val / (1073741824 / sep)) / sep;
        unit = 'GB';
    } else if (val >= li * 1000) {
        val = Math.round(val / (1048576 / sep)) / sep;
        unit = 'MB';
    } else if (val >= li) {
        val = Math.round(val / (1024 / sep)) / sep;
        unit = 'KB';
    }
    return val + unit;
}



/*ed200*******/

function eD2kCheckAll(str, checked) {
    var a = document.getElementsByName(str);
    var n = a.length;

    for (var i = 0; i < n; i++) {
        a[i].checked = checked;
    }
    em_size(str);
}
function em_size(str) {
    var a = document.getElementsByName(str);
    var n = a.length;
    try {
        var input_checkall = document.getElementById("checkall_" + str);
        var size = 0;
        input_checkall.checked = true;
        for (var i = 0; i < n; i++) {
            if (a[i].checked) {
                var piecesArray = a[i].value.split("|");
                size += piecesArray[3] * 1;
            } else {
                input_checkall.checked = false;
            }
        }
        test = document.getElementById("size_" + str);
        test.innerHTML = gen_size(size, 3, 1);
    } catch (e) {

    }
}
function gen_size(d, a, b) { sep = Math.pow(10, b); a = Math.pow(10, a); retval = d; unit = "Bytes"; if (d >= a * 1000000000) { d = Math.round(d / (1099511627776 / sep)) / sep; unit = "TB" } else { if (d >= a * 1000000) { d = Math.round(d / (1073741824 / sep)) / sep; unit = "GB" } else { if (d >= a * 1000) { d = Math.round(d / (1048576 / sep)) / sep; unit = "MB" } else { if (d >= a) { d = Math.round(d / (1024 / sep)) / sep; unit = "KB" } } } } return d + unit }



function download(str, i, first) {
    var a = document.getElementsByName(str);
    var n = a.length;

    //尝试使用activex方式批量新增下载
    try {
        var ed2k_links = '';
        var ax = new ActiveXObject("IE2EM.IE2EMUrlTaker");
        var emule_version = ax.GetEmuleVersion();
        if ('e' != emule_version.substr(0, 1)) {
            throw { errorCode: 'eMule not Installed.' };
        }
        for (var i = i; i < n; i++) {
            if (a[i].checked) {
                if (ed2k_links == '') {
                    ed2k_links = a[i].value;
                } else {
                    ed2k_links += "\n" + a[i].value;
                }
            }
        }
        ax.SendUrl(ed2k_links, 'dd', document.location);
        delete ax;
        return;
    } catch (e) { }

    if (!window.continueDown) {
        //使用最旧的方法来批量新增下载
        for (var i = i; i < n; i++) {
            if (a[i].checked) {
                window.location = a[i].value;
                if (first)
                    timeout = 6000;
                else
                    timeout = 500;
                i++;
                window.setTimeout("download('" + str + "', " + i + ", 0)", timeout);
                break;
            }
        }
    } else {
        //使用稍微新一点的方法来批量新增下载
        for (var i = i; i < n; i++) {
            if (a[i].checked) {
                if (first) {
                    var k = i;
                    var current_link = a[k].nextSibling;
                    var multi_text = '';
                    var tmp_counter = 0;
                    var comma = '';
                    while (true) {
                        if (a[k].checked && current_link) {//如果是有效节点并且被选中
                            if (current_link.href) {
                                if (current_link.href.indexOf('ed2k') !== 0) {
                                    current_link = current_link.nextSibling;
                                    continue;
                                }
                                if (tmp_counter > 7) {//收集超过若干个有效链接后，退出
                                    multi_text += '<br />…………';
                                    break;
                                }
                                var right_link = current_link;
                                tmp_counter++;
                                if (navigator.userAgent.toLowerCase().indexOf("msie") == -1) {
                                    multi_text += comma + current_link.text;
                                } else {
                                    multi_text += comma + current_link.innerText;
                                }
                                comma = '<br />';
                            }

                            current_link = current_link.nextSibling;
                        } else {//未被选中，或往下没有相邻节点了，那么切换到下个父节点
                            if (++k >= n) {//如果父节点也到底了，那么退出
                                break;
                            }
                            current_link = a[k].nextSibling;
                        }
                    }
                    downPopup(right_link, multi_text);
                }

                continueDown(a[i].value);
                //window.location=a[i].value;
                if (first)
                    timeout = 6000;
                else
                    timeout = 500;
                i++;
                window.setTimeout("download('" + str + "', " + i + ", 0)", timeout);
                break;
            }
        }
    }

}

function copy(str) {

    var a = document.getElementsByName(str);
    var n = a.length;
    var ed2kcopy = "";
    for (var i = 0; i < n; i++) {
        if (a[i].checked) {
            ed2kcopy += a[i].value;
            ed2kcopy += "\r\n";
        }
    }
    copyToClipboard(ed2kcopy);
}
function MagnetRequest(paras, url) {
    var paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
    var paraObj = {}
    for (i = 0; j = paraString[i]; i++) {
        paraObj[j.substring(0, j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=") + 1, j.length);
    }
    var returnValue = paraObj[paras.toLowerCase()];
    return returnValue;
}
function ShowMagnet(MagnetURI) {
    MagnetDn = MagnetRequest("dn", MagnetURI)

    if (MagnetDn == undefined || MagnetDn == "") {
        MagnetDn = "下载地址 DOWNLOAD";
        XunLeiFilename = "90xz.COM";
    } else {
        MagnetURI = MagnetURI.replace(MagnetDn, MagnetDn + "(90xz.COM)");
        XunLeiFilename = MagnetDn
    }

    document.write("<tr class=CommonListCell><td width=870><img src='Images/magnet.png' border=0 /> <a href=\"" + MagnetURI + "\">" + MagnetDn + "</a></td><td width=80 align=center>" + FormatSize(MagnetRequest("xl", MagnetURI)) + "</td></tr>")
}
function FormatSize(ByteSize) {
    if (ByteSize >= 1099511627776) {
        ByteSize = Math.round(ByteSize / 1099511627776 * 100) / 100 + " TB"
    } else if (ByteSize >= 1073741824) {
        ByteSize = Math.round(ByteSize / 1073741824 * 100) / 100 + " GB"
    } else if (ByteSize >= 1048576) {
        ByteSize = Math.round(ByteSize / 1048576 * 100) / 100 + " MB"
    } else if (ByteSize >= 1024) {
        ByteSize = Math.round(ByteSize / 1024 * 100) / 100 + " KB"
    } else if (ByteSize > 0) {
        ByteSize = ByteSize + " 字节"
    } else {
        ByteSize = "<img src='Images/magnet-icon-14w-14h.gif'>";
    }
    return ByteSize;
}

/*
eD2k Link Selector Main JavaScript
by tomchen1989
http://emulefans.com/wordpress-ed2k-link-selector/
GPL v2
*/
var ed2kls = { $: function (a) { return document.getElementById(a) }, $n: function (a) { return document.getElementsByName(a) }, $c: function (b, c, d) { d = d || document; c = c || "*"; var e = []; if (document.getElementsByClassName && Array.filter) { if (c == "*") { return d.getElementsByClassName(b) } else { e = Array.filter(d.getElementsByClassName(b), function (a) { return a.tagName == c.toUpperCase() }) } } else { var f = d.getElementsByTagName(c); var g = new RegExp("(^|\\s)" + b + "(\\s|$)"); for (i = 0, j = 0, l = f.length; i < l; i++) { if (g.test(f[i].className)) { e[j] = f[i]; j++ } } } return e }, ht: function (a, b) { for (var c = a.firstChild; c !== null; c = c.nextSibling) { if (c.nodeType == 3) { c.nodeValue = b; return true } } return false }, help: function (a, b) { var c = ed2kls.$("el-s-info-" + a); var d = ed2kls.$("el-s-info-content-" + a); d.innerHTML = ""; var e = ed2kls.$("el-s-info-content-str-" + b).cloneNode(true); e.id = ""; d.appendChild(e); if (c.style.display == "none") { if (typeof jQuery == "undefined") { c.style.display = "block" } else { jQuery(c).slideDown(300) } } this.cb.init() }, closeinfo: function (a) { if (typeof jQuery == "undefined") { ed2kls.$("el-s-info-" + a).style.display = "none" } else { jQuery(ed2kls.$("el-s-info-" + a)).slideUp(300) } this.cb.init() }, close: function (a) { var b = ed2kls.$("el-s-tb-" + a); var c = ed2kls.$("el-s-exd-" + a); if (b.style.display == "none") { ed2kls.ht(c, "[-]"); if (typeof jQuery != 'undefined' && !jQuery.browser.msie) { jQuery(b).fadeIn("slow") } else { b.style.display = "table-row-group" } c.setAttribute("title", ed2klsVar.shk) } else { ed2kls.ht(c, "[+]"); if (typeof jQuery != 'undefined' && !jQuery.browser.msie) { jQuery(b).fadeOut("slow") } else { b.style.display = "none" } c.setAttribute("title", ed2klsVar.exd) } this.cb.init() }, cb: { main: function (d, e) { var f = new ZeroClipboard.Client(); var g = false; f.setHandCursor(true); f.addEventListener("load", function (a) { g = true }); f.addEventListener("mouseOver", function (b) { var a = ed2kls.$n("el-s-chkbx-" + e + "[]"); var n = a.length; var c = ""; for (var i = 0; i < n; i++) { if (a[i].checked) { if (d == 1) { c += ed2kls.getName(a[i].value) + "\n" } else if (d == 2) { c += a[i].value + "\n" } } } f.setText(c) }); f.addEventListener("complete", function (a, b) { var c = ed2kls.$("el-s-copied-" + e); if (!g) { alert(ed2klsVar.retry) } else { c.style.display = "inline"; window.setTimeout(function () { c.style.display = "none" }, 1000) } }); if (d == 1) { f.glue("el-s-copynames-" + e) } else if (d == 2) { f.glue("el-s-copylinks-" + e) } }, init: function () { var a = ed2kls.$c("ZeroClipboard_ED2k", "embed"); for (var j = 0, l = a.length; j < l; j++) { var b = a[j].parentNode; b.parentNode.removeChild(b) } var c = ed2kls.$c("el-s-copylinks", "input"); var n = c.length; var d; for (var i = 0; i < n; i++) { d = c[i].id; d = d.substr(d.lastIndexOf("-") + 1); if (ed2kls.$("el-s-totsize-" + d)) { this.main(1, d) } this.main(2, d) } }, exe: function () { if (window.addEventListener) { window.addEventListener("load", function () { ed2kls.cb.init() }, false) } }, iecopy: function (b, c) { if (!window.addEventListener) { var a = ed2kls.$n("el-s-chkbx-" + c + "[]"); var n = a.length; var d = ""; for (var i = 0; i < n; i++) { if (a[i].checked) { if (b == 1) { d += ed2kls.getName(a[i].value) + "\n" } else if (b == 2) { d += a[i].value + "\n" } } } window.clipboardData.setData("Text", d); var e = ed2kls.$("el-s-copied-" + c); e.style.display = "inline"; window.setTimeout(function () { e.style.display = "none" }, 1000) } else { this.init(); alert(ed2klsVar.retry) } } }, formatSize: function (a, b) { var c = 100; var d = ed2klsVar.bytes; if (a >= 1099511627776) { a = Math.round(a / (1099511627776 / c)) / c; d = ed2klsVar.tb } else if (a >= 1073741824) { a = Math.round(a / (1073741824 / c)) / c; d = ed2klsVar.gb } else if (a >= 1048576) { a = Math.round(a / (1048576 / c)) / c; d = ed2klsVar.mb } else if (a >= 1024) { a = Math.round(a / (1024 / c)) / c; d = ed2klsVar.kb } return a + d }, getName: function (a) { var b; b = decodeURIComponent(a); b = b.split("|")[2]; return b }, getSize: function (a) { var b; b = decodeURIComponent(a); b = +b.split("|")[3]; return b }, clear: function (a) { if (ed2kls.$("el-s-namefilter-" + a)) { ed2kls.$("el-s-namefilter-" + a).value = ""; var b = ed2kls.$n("el-s-chktype-" + a + "[]"); var n = b.length; for (var i = 0; i < n; i++) { b[i].checked = false } } if (ed2kls.$("el-s-sizesymbol-" + a + "-1")) { ed2kls.$("el-s-sizesymbol-" + a + "-1").selectedIndex = 0; ed2kls.$("el-s-sizefilter-" + a + "-1").value = ""; ed2kls.$("el-s-sizeunit-" + a + "-1").selectedIndex = 0; ed2kls.$("el-s-sizesymbol-" + a + "-2").selectedIndex = 0; ed2kls.$("el-s-sizefilter-" + a + "-2").value = ""; ed2kls.$("el-s-sizeunit-" + a + "-2").selectedIndex = 0 } }, total: function (b) { var c = (ed2kls.$("el-s-totsize-" + b)) ? true : false; var a = ed2kls.$n("el-s-chkbx-" + b + "[]"); var n = a.length; var d = 0; var e = 0; var f = ed2kls.$("el-s-chkall-" + b); for (var i = 0; i < n; i++) { if (a[i].checked) { if (c) { d += this.getSize(a[i].value) } e++ } } f.checked = (e == n) ? true : false; if (c) { ed2kls.ht(ed2kls.$("el-s-totsize-" + b), this.formatSize(d, b)) } ed2kls.ht(ed2kls.$("el-s-totnum-" + b), e) }, initChk: -1, checkIt: function (a, b) { var c = b || window.event; var d = c.target || c.srcElement; tarNum = d.id; tarNum = tarNum.substr(tarNum.lastIndexOf("-") + 1); tarNum = tarNum - 1; if (!c.shiftKey) { this.initChk = tarNum } else { var e = ed2kls.$n("el-s-chkbx-" + a + "[]"); var f = Math.min(tarNum, this.initChk); var g = Math.max(tarNum, this.initChk); for (var i = f + 1; i <= g - 1; i++) { e[i].checked = e[i].checked ? false : true } } this.total(a); this.clear(a) }, checkAll: function (b, c) { var a = ed2kls.$n("el-s-chkbx-" + b + "[]"); var n = a.length; for (var i = 0; i < n; i++) { a[i].checked = c } this.total(b); this.clear(b) }, download: function (b) { var a = ed2kls.$n("el-s-chkbx-" + b + "[]"); var n = a.length; var c = []; for (var i = 0; i < n; i++) { if (a[i].checked) { c.push(a[i].value) } } var l = c.length; if (l === 0) { return false } var d = 6000; var j = 0; var e = function () { window.location = c[j]; if (j < l - 1) { j++; window.setTimeout(function () { d = 500; e() }, d) } }; e() }, test: function (b, c) { if (b === "" || b === undefined || c === "") { return true } b = b.replace(/\"(.+?)\"/g, function (a) { a = a.substr(1, a.length - 2); a = a.replace(/\s/g, "\\u0020").replace(/\+/g, "\\u002B").replace(/-/g, "\\u002D").replace(/\|/g, "\\u007C").replace(/\^/g, "\\u005E").replace(/\$/g, "\\u0024"); return a }); b = b.replace(/[\s\+)]*\-/g, " -").replace(/\|\s-/g, "|-").replace(/([\\\.\{\}\[\]\(\)\*\+\?])/g, "\\$1").replace(/\\(\\u[0-9A-F]{4})/g, "$1"); var d = b.split(/[\s\+]+/); for (var i = 0, l = d.length; i < l; i++) { var e = d[i]; if (e !== "") { if (/\|/.test(e)) { var f = e.split("|"); var g = false; for (var j = 0, jl = f.length; j < jl; j++) { var h = f[j]; if (h !== "") { if ((h.charAt(0) != "-" && new RegExp(h, "i").test(c) === true) || (h.charAt(0) == "-" && new RegExp(h.substr(1, h.length - 1), "i").test(c) === false)) { g = true } } } if (g === false) { return false } } else if ((e.charAt(0) != "-" && new RegExp(e, "i").test(c) === false) || (e.charAt(0) == "-" && new RegExp(e.substr(1, e.length - 1), "i").test(c) === true)) { return false } } } return true }, testSize: function (a, b, c, d) { if (c === "" || c === undefined) { return true } else { var e = c * d; switch (b) { case "1": if (a > e) { return true } break; case "2": if (a < e) { return true } break; default: return true } return false } }, filter: function (a) { this.filterRun(a); this.setChktype(a); this.total(a) }, filterRun: function (b) { var c, str, sizesymbol1, sizefilter1, sizeunit1, sizesymbol2, sizefilter2, sizeunit2; if (ed2kls.$("el-s-namefilter-" + b)) { c = ed2kls.$("el-s-namefilter-" + b); str = c.value } if (ed2kls.$("el-s-sizesymbol-" + b + "-1")) { sizesymbol1 = ed2kls.$("el-s-sizesymbol-" + b + "-1"); sizesymbol1 = sizesymbol1.options[sizesymbol1.selectedIndex].value; sizefilter1 = ed2kls.$("el-s-sizefilter-" + b + "-1").value; sizeunit1 = ed2kls.$("el-s-sizeunit-" + b + "-1"); sizeunit1 = sizeunit1.options[sizeunit1.selectedIndex].value; sizesymbol2 = ed2kls.$("el-s-sizesymbol-" + b + "-2"); sizesymbol2 = sizesymbol2.options[sizesymbol2.selectedIndex].value; sizefilter2 = ed2kls.$("el-s-sizefilter-" + b + "-2").value; sizeunit2 = ed2kls.$("el-s-sizeunit-" + b + "-2"); sizeunit2 = sizeunit2.options[sizeunit2.selectedIndex].value } var a = ed2kls.$n("el-s-chkbx-" + b + "[]"); var n = a.length; for (var i = 0; i < n; i++) { a[i].checked = (this.test(str, this.getName(a[i].value)) && this.testSize(this.getSize(a[i].value), sizesymbol1, sizefilter1, sizeunit1) && this.testSize(this.getSize(a[i].value), sizesymbol2, sizefilter2, sizeunit2)) ? true : false } }, setChktype: function (a) { var b = ed2kls.$("el-s-namefilter-" + a); if (b) { var c = ed2kls.$n("el-s-chktype-" + a + "[]"); var d = ed2kls.$("el-s-namefilter-" + a).value; var n = c.length; var e, str; for (var i = 0; i < n; i++) { str = c[i].value; e = new RegExp("\\." + str + "\\$", "i"); c[i].checked = e.test(d) ? true : false } } }, typeFilter: function (a, b, c) { var d = ed2kls.$("el-s-namefilter-" + a); var e = /(\.\S+?\$)(\|\.\S+?\$)*/i; var f = new RegExp("\\|\\." + b + "\\$|\\." + b + "\\$\\||\\." + b + "\\$", "i"); d.value = d.value.replace(f, ""); if (c) { if (e.test(d.value)) { d.value = d.value.replace(e, "$&|." + b + "$") } else { if (d.value !== "" && d.value.substr(d.value.length - 1, 1) !== " ") { d.value += " " } d.value += "." + b + "$" } } this.filterRun(a); this.total(a) }, emclChk: function (b) { var a = ed2kls.$n("el-s-chkbx-" + b + "[]"); var n = a.length; for (var i = 0; i < n; i++) { if (a[i].checked) { return true } } return false }, exe: function () { if (window.addEventListener) { window.addEventListener("load", ed2kls.init, false) } else if (window.attachEvent) { window.attachEvent("onload", ed2kls.init) } }, init: function () { var a = ed2kls.$c("el-s-namefilter", "input").concat(ed2kls.$c("el-s-sizefilter", "input")); for (var i = 0, l = a.length; i < l; i++) { a[i].value = "" } var b = ed2kls.$c("el-s-chkbx", "input"); for (var j = 0, jl = b.length; j < jl; j++) { var c = b[j]; if (/el-s-chktype/.test(c.className)) { c.checked = false } else { c.checked = true } } } }; ed2kls.cb.exe(); ed2kls.exe();